package com.example.demo.hcontroller;


import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.example.demo.pojo.User;
import com.example.demo.service.IUserService;

import java.util.List;

@Controller
@RequestMapping("/hindex")
public class IndexController {

	
	@Resource
	private IUserService userService;




	@RequestMapping("/viewhome")
	public String viewindex1(HttpServletRequest request, Model model,User user) {

		List<User> ulist = userService.selectAllUser(user);
		model.addAttribute("unum", ulist.size());
		return "index";
	}
	
}
